<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class TeamP extends Model
{
    //
    public $table = 'team_p';

    public $fillable = ['tm_openid','tm_id','is_t'];

    public $timestamps = false;


    public function getTeamPMyTeamId($teamId){
        $member = new Member();
        return \DB::table($this->table . ' as tp')
            ->leftJoin($member->getTable() . ' as m' , 'm.openid' , '=' , 'tp.tm_openid')
            ->where('tp.tm_id' , $teamId)
            ->get();
    }
}
